<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang=”zh-CN” dir=”ltr” lang=”zh-CN”>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
<?php if( is_home() ){ ?><link rel="canonical" href="<?php bloginfo("url"); ?>" /><?php } ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/favicon.ico"/>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/jquery.min.js">\x3C/script>')</script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/comment_recent_cache.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/dh_say_ajax.js"></script>
<?php if (is_home()){?>
<!-- home页面使用的css -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/index.css" />
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>-->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/index_ajax_navi.js"></script>
<?php } elseif ( is_singular() ){ ?>
<!-- single页面使用的css -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/single.css" />
<?php } elseif ( is_archive() || is_search() ){ ?>
<!-- archive或者search页面使用的css -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/archive.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/jquery.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/archive_ajax_navi.js"></script>
<?php } elseif( is_404() ){ ?>
<!-- 404页面使用的css -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/404.css" />
<?php } else{}?>

<?php wp_head(); ?>
<!-- single页面评论动画效果 -->
<?php if ( function_exists('is_singular')) : ?>
<?php if ( is_singular() ){ ?>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>-->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/jquery.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/comment_ajax_navi.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/dh_comments_ajax.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/article_index.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/functions/smiley_ajax.js"></script>
<?php } ?>
<?php endif; ?>
<?php 
	//得到keyword和description
	if(is_single())
	{
		$description = $post->post_title;
		$keywords = "";
		$tags = wp_get_post_tags($post->ID);
		$i=1;
		foreach($tags as $tag) 
		{
			if($i = 1)
			 $keywords = $keywords . $tag->name;
			else 
			 $keywords = $keywords . ", ".$tag->name;
			$i++;
		}
	} else {
		$description = get_bloginfo('description');
		$keywords = get_bloginfo('name');
	}
?>
<meta name="description" content="<?=$description?>" />
<meta name="keywords" content="<?=$keywords?> <?=$description?>" />
</head>
<!--end: head-->
<body>
<div id="wrapper">
<div id="top">
  <div class='topnav'>
    <div class="left">
        <div>
		<ul class="menu">
		<li><a href="<?php echo get_option('home'); ?>">首页</a></li> 
		<li><a href="<?php echo get_option('home'); ?>/?page_id=21">关于本站</a></li> 
		<li><a href="<?php echo get_option('home'); ?>/archivers/">本站导航</a></li> 
		<li><a href="<?php echo get_option('home'); ?>/?page_id=22">本站共享</a></li> 
		<li><a href="<?php echo get_option('home'); ?>/?page_id=20">友情链接</a></li> 
		<li><a href="<?php echo get_option('home'); ?>/?page_id=19">给我留言</a></li> 
		</ul>
        </div> 
    </div>
    <!--end: left-->
    <div class="right">	
		<?php if (get_theme_mod('search') == 'Yes') { ?>  
			<div >   
			<?php echo stripslashes(get_theme_mod('search_content')); ?>
			</div>
		<?php }else{ ?>
			<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
				<div id="search">
				  <input class="searchinput" type="text" value="在本站内搜索..." onclick="this.value='';" name="s" id="s" />
				  <input type="submit" class="searchsubmit" value="GO"/>
				</div>
			</form>
		<?php } ?>
    </div>
    <!--end: right-->
  </div>
</div>
<!--end: top-->
<div id="header"> 
  <div  class="toplink">
    <ul>
      <li><a href="<?php bloginfo('rss2_url'); ?>" target="_blank">文章RSS</a></li>
	  <li><a href="<?php bloginfo('comments_rss2_url'); ?>" target="_blank">评论RSS</a></li>
	  <li>
	  	<script type="text/javascript">
		function showdate() //显示系统日期   
		{   
			var now = new Date();
			var year = now.getFullYear();
			var month = now.getMonth()+1; 
			var day = now.getDate();
			return year+"年"+month+"月"+day+"日";   
		}
		document.write(showdate());
		</script>	
	  </li>
   </ul>
  </div>
  <div style="position:absolute;top:70px;right:10px;">
	<a href="<?php echo get_option('home'); ?>/archivers/"> 归档版本</a>
  </div>  
  <div style="position:absolute;top:5px;left:35px;">
   <object type="application/x-shockwave-flash" data="<?php bloginfo('template_directory'); ?>/images/relog.swf" WIDTH=80 HEIGHT=80>
    <param name="movie" value="<?php bloginfo('template_directory'); ?>/images/relog.swf" />
    <param name="WMode" value="Transparent" />
   </object>
  </div>
  <div class="logo">
    <h1 ><a href="<?php bloginfo('url'); ?>/">
      <?php bloginfo('name'); ?>
      </a></h1>
    <h2 class="description">
      <?php bloginfo('description'); ?>
    </h2>
  </div>
</div>
<!--end: header-->
<div class="topnav menunav">
	<div class="left">
		<ul>
		<?php dh_list_categories(); ?>
		</ul> 
	</div>

  	<script type="text/javascript">
		function showWarning() //显示系统日期   
		{   
			var now = new Date();
			var hour = now.getHours();
			if(hour>=23||hour<=6)
			{
				var message='<div style="border:2px solid #FF3300;font-size:12px;margin:2px 20px 0 440px;background:#FFFFDF;padding:2px;">提醒: 已经是夜里 ';
				message +=hour;
				message +=' 点多了，为了您和家人的健康，请注意按时作息减少熬夜。</div>';				
			    return message;
			}
			else 
			{			
			   return '<?php if (get_theme_mod('dh_say') == 'Yes') { ?> <div id="dh_say_content" class="right" style="margin:4px 0 2px 0"><p id="dh_say" title="点击可查看下一条"><?php dh_say();?></p></div><?php }?>';
			}
		}
		document.write(showWarning());
	</script>
	<div id="dh_say_content" class="right" style="margin:4px 0 2px 0">
		<p id="dh_say" title="点击可查看下一条"><?php dh_say();?></p>
	</div>
  <!--end: right-->
</div>
<!--end: menunav-->
<!--end: topad-->
<?php if (get_theme_mod('top') == 'Yes') { ?>  
<div class="top_content">   
<?php echo stripslashes(get_theme_mod('top_content')); ?>
</div>
<?php } ?>